/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sistema.gestionuniversitaria.dataLayer;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author PERSONAL
 */
public class BaseData {

    protected Connection conexion;

    public BaseData() {
    }

    public void getConexion() throws SQLException, ClassNotFoundException {

        Class.forName("oracle.jdbc.driver.OracleDriver");
        String url = "jdbc:oracle:thin:@localhost:1521:XE";
        String userName = "KUROSAKI29";
        String password = "max2911";
        try {
            this.conexion = DriverManager.getConnection(url, userName, password);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void desconectar() throws SQLException {
        if (!conexion.isClosed()) {
            conexion.close();
        }
    }
}
